layui.use(['table', 'HttpRequest', 'func', 'form', 'laydate', 'gunsSelect'], function () {
    var $ = layui.$;
    var HttpRequest = layui.HttpRequest;
    // 获取并解码URL参数
    var request = new HttpRequest(Feng.ctxPath + "/works/detail?workId=" + Feng.getUrlParam("workId"), 'get');
    var result = request.start();
    var data = result.data;
    if (data){
        if (data.workVideoUrl) {
            $('#play').attr({
                'video-url': data.workVideoUrl,
                // 'poster': data.workImgUrl, // 清空默认的封面图
               // 'autoplay': false,
               // 'controls': true
            });
        } else {
            // 如果没有视频地址，显示提示信息
            $('#play').parent().html(`
            <div style="text-align: center; padding: 50px 0; color: #999;">
                <i class="layui-icon layui-icon-face-cry" style="font-size: 30px; display: block; margin-bottom: 10px;"></i>
                暂无视频资源
            </div>
        `);
        }

        if (data.workDeptName && data.workAuthor){
            // let title = data.workDeptName + "-" + data.workAuthor + "（" + data.voteNum + "票）"
            let title = data.workDeptName + "-" + data.workAuthor
            $("#title").html(title)
        }
    }



});